package org.annoflow.policy;

import java.util.HashMap;

public class TopSecretPolicy implements PolicyType 
{
	public TopSecretPolicy() {}
	
	@Override
	public void assess(HashMap<String, String> context) throws Exception {
		if ("topsecret".equals(context.get("level")))
			return;
		throw new Exception();
	}

	@Override
	public boolean audit(Object o,String filterName,Class<?> methodOwner) {
		return true;
	}

	public String getPolicyCode()
	{
		return "org.annoflow.policy.TopSecretPolicy.addPolicy($class);";
	}

	@Override
	public PolicyType generateOrigin() {
		// TODO Auto-generated method stub
		return null;
	}
	
	public static void addPolicy(Class<?> clazz) {
		PolicyManager.addClassPolicy(clazz, new TopSecretPolicy());
	}

}
